package com.example.shoppingmall.service;

import com.example.shoppingmall.dao.StoreClerkMapper;
import com.example.shoppingmall.pojo.StoreClerk;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StoreClerkService {

    @Autowired
    StoreClerkMapper storeClerkMapper;

    //查询当前店铺的店员+分页
    public List<StoreClerk> stcList(Integer store_id, Integer pageNo, Integer pageNum){
        return storeClerkMapper.stcList(store_id,pageNo, pageNum);
    }

    //查询总条数
    public int total(Integer store_id){
        return storeClerkMapper.total(store_id);
    }

    //查询店铺
    public List<StoreClerk> getStoreName(){
        return storeClerkMapper.getStoreName();
    }

    //查询店铺用户
    public StoreClerk getClerkPhone(String clerk_phone,Integer store_id){
        return storeClerkMapper.getClerkPhone(clerk_phone,store_id);
    }

    //查询店员名称
    public StoreClerk getClerkName(String clerk_name,Integer store_id){
        return storeClerkMapper.getClerkName(clerk_name,store_id);
    }

    //根据当前用户新增店员
    public int stcAdd(StoreClerk storeClerk){
        return storeClerkMapper.stcAdd(storeClerk);
    }

    //根据id删除当前店铺的店员
    public int stcDelete(Integer id){
        return storeClerkMapper.stcDelete(id);
    }

    //根据商店id删除店员
    public int stcoDel(Integer store_id){
        return storeClerkMapper.stcoDel(store_id);
    }

}
